function OperationsItem(){
	this.operationType="";
	this.itemId="";
	this.itemName="";
	this.amount= 0;
	this.exchangeItems = new Array();
};

OperationsItem.prototype.setId = function(iid){
	this.itemId = iid;
};
OperationsItem.prototype.setName = function(iname){
	this.itemName = iname;
};
OperationsItem.prototype.setAmount = function(iamount){
	this.amount = iamount;
};
OperationsItem.prototype.setType = function(itype){
	this.operationType = itype;
};
OperationsItem.prototype.addExchangeItem = function(iexchangeItem){
	this.exchangeItems.push(iexchangeItem);
};

OperationsItem.prototype.getOperationsItemJsonString = function(){
	var jsonString ="{";
	jsonString+="\"amount\":"+this.amount;
	jsonString+=",\"itemId\":"+this.itemId;
	jsonString+=",\"operationType\":"+this.operationType;
	jsonString+=",\"name\":\""+this.itemName+"\"";
	jsonString+=",\"exchangeItems\":[";
	var ilength = this.exchangeItems.length;
	for(var i in this.exchangeItems){
		var subItem = this.exchangeItems[i];
		jsonString+=subItem.getItemJsonString();
		if(i<ilength-1){
			jsonString+=",";
		}
	}
	jsonString+="]}";
	return jsonString;
};

OperationsItem.generateOperationsItemArrayJsonString = function(itemArray){
	var jsonArrayString = "[";
	var ilength = itemArray.length;
	for(var i in itemArray){
		 jsonArrayString +=itemArray[i].getOperationsItemJsonString();
		 if(i<ilength-1){
			jsonArrayString+=",";
		 }
	}
	 jsonArrayString +="]";
	 return jsonArrayString;
};